package com.cskaoyan.shopping.api;

import com.cskaoyan.mall.dto.AllItemServiceResponse;
import com.cskaoyan.mall.dto.AllItemServiceResponseUtil;
import com.cskaoyan.mall.dto.ItemDto;
import com.cskaoyan.shopping.dal.entitys.Item;
import com.cskaoyan.shopping.service.impl.ISearcherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName SearchApiImpl
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/27 20:28
 **/
@RestController
public class SearchApiImpl {

    @Autowired
    ISearcherService iSearcherService;

    @GetMapping("/rpc/items")
    public AllItemServiceResponse getAllProductItem() {
        List<ItemDto> itemList = iSearcherService.getAllProductItem();

        return new AllItemServiceResponseUtil().setData(itemList);
    }

}
